<?php

namespace app\rental\model;

use app\admin\model\RouteModel;
use think\Model;
use tree\Tree;

class RentalBrandModel extends Model
{

    public static   $STATUS = array(
        1=>"已启用",
        0=>"未启用",
    );
    /**
     * 关联汽车
     */
    public function cars()
    {
        return $this->hasMany('RentalCarModel','brand_id');
    }
    public function setIconAttr($value){
       return  cmf_asset_relative_url($value);
    }
    public function getBrands()
    {
        return $this->where(['status'=>1])->order('list_order', 'desc')->field('id,name,icon')->select()->toArray();
    }
}
